<?php
	/*
	 * AJAX call to save a phonenumber filter into the database.
	 * Numbers are stored in the table "filernumbers".
	 *
	 * Variables:
	 *   txt (string) : the phonenumber
	 *
	 * Returns: string (error or html code)
	 *
	 */

	$sql = mysql_query("INSERT INTO filternumbers SET fnNR=\"".mysql_real_escape_string(stripslashes($_GET["txt"]))."\", fnEnterDate=NOW()");
	if(mysql_error() != ""){
		echo mysql_error();
	}else{
		echo '<div id="filtnr'.mysql_insert_id().'" class="listdiv">';
		echo '<a style="float:right" href="javascript:delfiltnr('.mysql_insert_id().')"><img src="'.$url_prefix.'images/cross.png" /></a>';
		echo mysql_real_escape_string(stripslashes($_GET["txt"]));
		echo '</div>';
	}
	exit;
?>